<%@ page import="java.util.Date" %>
<%@ page import="cn.school.mybatis.pojo.Admin" %><%--
  Created by IntelliJ IDEA.
  User: zhaoyang
  Date: 2020/8/3
  Time: 11:43 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎登录</title>
</head>
<body>
<%
    //String name=request.getParameter("username");
//    String name= (String) session.getAttribute("USER_LOGIN");
    Admin admin= (Admin) session.getAttribute("USER_LOGIN");

    String id=session.getId();

    Date date1=new Date(session.getCreationTime());
    String d1=date1.toLocaleString();
    Date date2=new Date(session.getLastAccessedTime());
    String d2=date2.toLocaleString();

//    if (name==null){
%>
<%--<script>--%>
<%--    if(confirm("请登录账号！")){--%>
<%--        location.replace("login.jsp");--%>
<%--    }else {--%>
<%--        location.replace("loginFail.jsp");--%>
<%--    }--%>
<%--</script>--%>

<%
//    }
//    页面访问次数
    if (session.getAttribute("pageCount") == null) {
        session.setAttribute("pageCount", 0);
    }
    int count = (int) session.getAttribute("pageCount");
    session.setAttribute("pageCount", ++count);
    count = (int) session.getAttribute("pageCount");


%>
<div>

    登录成功！<%=admin.getUsername()%>欢迎您！


    <br/>sessionID:<%=id%>
    <br/>创建时间:<%=d1%>
    <br/>最近访问时间:<%=d2%>
    <br/>页面访问次数:<%=count%>
    <br/> <a href="loginOut.jsp">退出</a>
</div>
</body>
</html>
